package cn.ruleengine.web.function;


import cn.hutool.core.collection.CollectionUtil;
import cn.ruleengine.core.annotation.Executor;
import cn.ruleengine.core.annotation.Function;
import lombok.Data;

import java.util.Collection;

/**
 * @author xianrensawang
 * @date 2021/7/13
 */
@Function
public class CollectionJoin {

    @Executor
    public Boolean joinJudge(CollectionParam param) {
        Collection<String> intersection = CollectionUtil.intersection(param.getLeft(), param.getRight());
        return CollectionUtil.isNotEmpty(intersection);
    }

    @Data
    public static class CollectionParam {

        private Collection<String> left;

        private Collection<String> right;
    }

}
